package com.tender.enums;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum DeviceEnum {

    PC("PC", "电脑端"),
    IPAD("IPAD", "PAD端"),
    APP("APP", "APP端"),
    ;

    /**
     * 服务名
     */
    private final String deviceType;
    /**
     * 描述
     */
    private final String describe;


    DeviceEnum(String deviceType, String describe) {
        this.deviceType = deviceType;
        this.describe = describe;
    }

    /**
     * 获取枚举类
     *
     * @param deviceType
     * @return
     */
    public static DeviceEnum getEnum(String deviceType) {
        return Arrays.stream(DeviceEnum.values()).filter(item ->
                item.getDeviceType().equalsIgnoreCase(deviceType)).findFirst().orElse(null);
    }
}
